}
fn find_path_deps(&mut self, manifest_path: &Path) -> CargoResult<()> {
- if self.members.iter().any(|p| p == manifest_path) {
+ let manifest_path = paths::normalize_path(manifest_path);
+ if self.members.iter().any(|p| p == &manifest_path) {
return Ok(())
}
debug!("find_members - {}", manifest_path.display());
- self.members.push(manifest_path.to_path_buf());
+ self.members.push(manifest_path.clone());
let candidates = {
- let pkg = match *self.packages.load(manifest_path)? {
+ let pkg = match *self.packages.load(&manifest_path)? {
MaybePackage::Package(ref p) => p,
MaybePackage::Virtual(_) => return Ok(()),
};
.with_stderr_contains("\
[ERROR] failed to parse manifest at `[..]`"));
}
+
+#[test]
+fn relative_path_for_member_works() {
+ let p = project("foo")
+ .file("foo/Cargo.toml", r#"
+ [project]
+ name = "foo"
+ version = "0.1.0"
+ authors = []
+
+ [workspace]
+ members = ["../bar"]
+ "#)
+ .file("foo/src/main.rs", "fn main() {}")
+ .file("bar/Cargo.toml", r#"
+ [project]
+ name = "bar"
+ version = "0.1.0"
+ authors = []
+ workspace = "../foo"
+ "#)
+ .file("bar/src/main.rs", "fn main() {}");
+ p.build();
+
+ assert_that(p.cargo("build").cwd(p.root().join("foo")), execs().with_status(0));
+ assert_that(p.cargo("build").cwd(p.root().join("bar")), execs().with_status(0));
+}
\ No newline at end of file